<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <p id="p">搜索</p>
    <script>
        var p = document.getElementById("p")
        console.log(location.search);
        var keyword = location.search.split("=")[1]
        var c = decodeURIComponent(keyword)  //转码
        p.innerHTML = c
    </script>
</body>
</html>